%% Author: zhangjun
%% Created: 2008-12-10
%% Description: TODO: Add description to sorttest
-module(sorttest).

%%
%% Include files
%%

%%
%% Exported Functions
%%
-export([start/1]).

%%
%% API Functions
%%

%%
%% TODO: Add description of start/function_arity
%%
start(Nums) -> 
	sort(Nums).

sort([]) ->
    [];
sort(Nums) -> %worst than lib_misc:qsort
	[H|_Rest] = Nums,
    sort([ N|| N<-Nums,N<H]) ++ [H] ++ sort([ N|| N<-Nums,N>H]).

%compute all perms
perms([]) -> [[]]; 
perms(L) -> [[H|T] || H <- L, T <- perms(L--[H])]. 

%%
%% Local Functions
%%

